package com.otherTest.designpattern.creationalpattern.abstractfactory.phoneversion;

import com.otherTest.designpattern.creationalpattern.abstractfactory.PhoneAbstractFactory;
import com.otherTest.designpattern.creationalpattern.abstractfactory.phonecolor.PhoneColor;

import java.util.Objects;

/**
 * @Description:
 * @author: conceit
 * @Date: 2018/8/31 0031 14:20
 */
public class PhoneVersionFactory extends PhoneAbstractFactory {


    @Override
    public PhoneColor selectPhoneColor(String phoneColor) {
        return null;
    }

    @Override
    public PhoneVersion selectPhoneVersion(String phoneVersion) {

        if (Objects.isNull(phoneVersion)) {
            return null;
        }
        if ("e3".equalsIgnoreCase(phoneVersion)) {
            return new PhoneVersionE3();
        } else if ("pro7".equalsIgnoreCase(phoneVersion)) {
            return new PhoneVersionPro7();
        }
        return null;
    }
}
